/*
 * Copyright (c) 2025 Li Auto Inc. and its affiliates
 * Licensed under the Apache License, Version 2.0(the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * {{get_generation_time()}}
 * {{get_project_name()}}
 * {{get_vcos_version()}}
 * Description:  1145的动态代码文件
 */

#include "cantrcv_tja1145.h"
#if (CONFIG_SERVM_ECUM == 1)
#include "sysm_init_cfg.h"
#include "sysm_init_types.h"
#endif

#define CANTRCV1145_START_SEC_CONST
#include "cantrcv1145_memmap.h"

CONST(cantrcv_channel_cate, CANTRCV1145_CONST) CanTrcv_Tja1145_ChannelUsed[CANTRCV_TJA1145_MAX_CHANNEL] = {
/* Index     ChannelUsed  ChannelName       */
{% for chnlName, chnlAttr in CanTrcvChannel.items() %}
{{ "/*  %s  */ %s,           /*  %s  */" | format((loop.index-1), chnlAttr["CanTrcvChannelUsed"], chnlName)}}
{% endfor %}
};

CONST(CanTrcv_TrcvModeType, CANTRCV1145_CONST) CanTrcv_Tja1145_ChannelInitState[CANTRCV_TJA1145_MAX_CHANNEL] = {
/* Index     ChannelInitState  ChannelName       */
{% for chnlName, chnlAttr in CanTrcvChannel.items() %}
{{ "/*  %s  */ %s,           /*  %s  */" | format((loop.index-1), chnlAttr["CanTrcvInitState"], chnlName)}}
{% endfor %}
};

CONST(cantrcv_fd_tolerance_en_cate, CANTRCV1145_CONST) CanTrcv_Tja1145_FdToleranceEnabled[CANTRCV_TJA1145_MAX_CHANNEL] = {
/* Index     FdToleranceEnabled    ChannelName        */
{% for chnlName, chnlAttr in CanTrcvChannel.items() %}
{{ "/*  %s  */ %s,                   /*  %s  */" | format((loop.index-1), chnlAttr["CanTrcvFdTolerance"], chnlName)}}
{% endfor %}
};

CONST(cantrcv_wakeup_bus_cate, CANTRCV1145_CONST) CanTrcv_Tja1145_WakeupByBusUsed[CANTRCV_TJA1145_MAX_CHANNEL] = {
/* Index     WakeupByBusUsed  */
{% for chnlName, chnlAttr in CanTrcvChannel.items() %}
{{"/* %s */   %s,   /* %s */" | format((loop.index - 1), chnlAttr["CanTrcvWakeupByBusUsed"], chnlName)}}
{% endfor %}
};

CONST(cantrcv_wakeup_src_cate, CANTRCV1145_CONST) CanTrcv_Tja1145_WakeupSource[CANTRCV_TJA1145_MAX_CHANNEL] = {
/* Index     WakeupSource  */
{% for chnlName, chnlAttr in CanTrcvChannel.items() %}
{{"/* %s */   %s,   /* %s */" | format((loop.index - 1), chnlAttr["CanTrcvWakeupSourceRef"], chnlName)}}
{% endfor %}
};

/**********************************************************************************************************************
  CanTrcv_Tja1145_WuSrcPor
**********************************************************************************************************************/
/* coverity[misra_c_2012_rule_2_8_violation:SUPPRESS] */
CONST(cantrcv_wakeup_src_port_cate, CANTRCV1145_CONST) CanTrcv_Tja1145_WuSrcPor[CANTRCV_TJA1145_MAX_CHANNEL] = {
/* Index     WuSrcPor  */
{% for chnlName, chnlAttr in CanTrcvChannel.items() %}
{{"/* %s */   %s,   /* %s */" | format((loop.index - 1), chnlAttr["CanTrcvPorWakeupSourceRef"], chnlName)}}
{% endfor %}
};


/**********************************************************************************************************************
  CanTrcv_Tja1145_WuSrcSyserr
**********************************************************************************************************************/
/* coverity[misra_c_2012_rule_2_8_violation:SUPPRESS] */
CONST(cantrcv_wk_src_err_cate, CANTRCV1145_CONST) CanTrcv_Tja1145_WuSrcSyserr[CANTRCV_TJA1145_MAX_CHANNEL] = {
/* Index     WuSrcSyserr  */
{% for chnlName, chnlAttr in CanTrcvChannel.items() %}
{{"/* %s */   %s,   /* %s */" | format((loop.index - 1), chnlAttr["CanTrcvSyserrWakeupSourceRef"], chnlName)}}
{% endfor %}
};

CONST(cantrcv_cfg_t, CANTRCV1145_CONST) CanTrcv_Tja1145_InitConfig = {
  .cantrcv_cfg_cate = 0
};

#define CANTRCV1145_STOP_SEC_CONST
#include "cantrcv1145_memmap.h"


#define CANTRCV1145_START_SEC_PRIVATE_BSS
#include "cantrcv1145_memmap.h"
/* coverity[misra_c_2012_rule_8_4_violation:SUPPRESS] */
VAR(uint8, CANTRCV1145_PRIVATE_BSS)  cantrcv_is_init;
#define CANTRCV1145_STOP_SEC_PRIVATE_BSS
#include "cantrcv1145_memmap.h"

#define CANTRCV1145_START_SEC_PRIVATE_BSS
#include "cantrcv1145_memmap.h"
/* coverity[misra_c_2012_rule_8_4_violation:SUPPRESS] */
VAR(cantrcv_prob_cate, CANTRCV1145_PRIVATE_BSS) cantrcv_prob[CANTRCV_TJA1145_MAX_CHANNEL];
#if defined(__TASKING__)
#pragma align 4
#endif
#if defined(__ghs__)
#pragma alignvar (4)
#endif
#define CANTRCV1145_STOP_SEC_PRIVATE_BSS
#include "cantrcv1145_memmap.h"

